using System;

using SubSonic;
using System.Data;

namespace Impact.Model.Services
{
    public partial class Procedures
    {

        /// <summary>
        /// Creates an object wrapper for the impact_CreateArticleTag Procedure
        /// </summary>
        public static StoredProcedure CreateArticleTag(int? articleId, int? tagId, string createdBy)
        {
            SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("impact_CreateArticleTag", DataService.GetInstance("SqlDataProvider"));

            sp.Command.AddParameter("@articleId", articleId, DbType.Int32);

            sp.Command.AddParameter("@tagId", tagId, DbType.Int32);

            sp.Command.AddParameter("@createdBy", createdBy, DbType.String);

            return sp;
        }


        /// <summary>
        /// Creates an object wrapper for the impact_DeleteSectionPlugin Procedure
        /// </summary>
        public static StoredProcedure DeleteSectionPlugin(int? SectionId, Guid? PluginId)
        {
            SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("impact_DeleteSectionPlugin", DataService.GetInstance("SqlDataProvider"));

            sp.Command.AddParameter("@SectionId", SectionId, DbType.Int32);

            sp.Command.AddParameter("@PluginId", PluginId, DbType.Guid);

            return sp;
        }

        /// <summary>
        /// Creates an object wrapper for the logging_ClearLogs Procedure
        /// </summary>
        public static StoredProcedure ClearLogs()
        {
            SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("logging_ClearLogs", DataService.GetInstance("SqlDataProvider"));

            return sp;
        }


        /// <summary>
        /// Creates an object wrapper for the logging_InsertCategoryLog Procedure
        /// </summary>
        public static StoredProcedure InsertCategoryLog(int? CategoryID, int? LogID)
        {
            SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("logging_InsertCategoryLog", DataService.GetInstance("SqlDataProvider"));

            sp.Command.AddParameter("@CategoryID", CategoryID, DbType.Int32);

            sp.Command.AddParameter("@LogID", LogID, DbType.Int32);

            return sp;
        }


        /// <summary>
        /// Creates an object wrapper for the logging_WriteLog Procedure
        /// </summary>
        public static StoredProcedure WriteLog(int? EventID, int? Priority, string Severity, string Title, DateTime? Timestamp, string MachineName, string AppDomainName, string ProcessID, string ProcessName, string ThreadName, string Win32ThreadId, string Message, string FormattedMessage, int? LogId)
        {
            SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("logging_WriteLog", DataService.GetInstance("SqlDataProvider"));

            sp.Command.AddParameter("@EventID", EventID, DbType.Int32);

            sp.Command.AddParameter("@Priority", Priority, DbType.Int32);

            sp.Command.AddParameter("@Severity", Severity, DbType.String);

            sp.Command.AddParameter("@Title", Title, DbType.String);

            sp.Command.AddParameter("@Timestamp", Timestamp, DbType.DateTime);

            sp.Command.AddParameter("@MachineName", MachineName, DbType.String);

            sp.Command.AddParameter("@AppDomainName", AppDomainName, DbType.String);

            sp.Command.AddParameter("@ProcessID", ProcessID, DbType.String);

            sp.Command.AddParameter("@ProcessName", ProcessName, DbType.String);

            sp.Command.AddParameter("@ThreadName", ThreadName, DbType.String);

            sp.Command.AddParameter("@Win32ThreadId", Win32ThreadId, DbType.String);

            sp.Command.AddParameter("@Message", Message, DbType.String);

            sp.Command.AddParameter("@FormattedMessage", FormattedMessage, DbType.String);

            sp.Command.AddOutputParameter("@LogId", DbType.Int32);

            return sp;
        }


        /// <summary>
        /// Creates an object wrapper for the logging_AddCategory Procedure
        /// </summary>
        public static StoredProcedure AddCategory(string CategoryName, int? LogID)
        {
            SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("logging_AddCategory", DataService.GetInstance("SqlDataProvider"));

            sp.Command.AddParameter("@CategoryName", CategoryName, DbType.String);

            sp.Command.AddParameter("@LogID", LogID, DbType.Int32);

            return sp;
        }



    }


}

